3.10 \(\int \frac{\sin (x)}{a \cos (x)+b \sin (x)} \, dx\)

Optimal. Leaf size=35 \[ \frac{b x}{a^2+b^2}-\frac{a \log (a \cos (x)+b \sin (x))}{a^2+b^2} \]

[Out]

(b*x)/(a^2 + b^2) - (a*Log[a*Cos[x] + b*Sin[x]])/(a^2 + b^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0566863, antiderivative size = 35, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3097, 3133} \[ \frac{b x}{a^2+b^2}-\frac{a \log (a \cos (x)+b \sin (x))}{a^2+b^2} \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]/(a*Cos[x] + b*Sin[x]),x]

[Out]

(b*x)/(a^2 + b^2) - (a*Log[a*Cos[x] + b*Sin[x]])/(a^2 + b^2)

Rule 3097

Int[sin[(c_.) + (d_.)*(x_)]/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp
[(b*x)/(a^2 + b^2), x] - Dist[a/(a^2 + b^2), Int[(b*Cos[c + d*x] - a*Sin[c + d*x])/(a*Cos[c + d*x] + b*Sin[c +
 d*x]), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]

Rule 3133

Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_)]*(
b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[((b*B + c*C)*x)/(b^2 + c^2), x] + Simp[((c*B - b*C)*L
og[a + b*Cos[d + e*x] + c*Sin[d + e*x]])/(e*(b^2 + c^2)), x] /; FreeQ[{a, b, c, d, e, A, B, C}, x] && NeQ[b^2
+ c^2, 0] && EqQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]

Rubi steps

\begin{align*} \int \frac{\sin (x)}{a \cos (x)+b \sin (x)} \, dx &=\frac{b x}{a^2+b^2}-\frac{a \int \frac{b \cos (x)-a \sin (x)}{a \cos (x)+b \sin (x)} \, dx}{a^2+b^2}\\ &=\frac{b x}{a^2+b^2}-\frac{a \log (a \cos (x)+b \sin (x))}{a^2+b^2}\\ \end{align*}

Mathematica [C]  time = 0.0550763, size = 47, normalized size = 1.34 \[ \frac{2 x (b-i a)-a \log \left ((a \cos (x)+b \sin (x))^2\right )+2 i a \tan ^{-1}(\tan (x))}{2 \left (a^2+b^2\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/(a*Cos[x] + b*Sin[x]),x]

[Out]

(2*((-I)*a + b)*x + (2*I)*a*ArcTan[Tan[x]] - a*Log[(a*Cos[x] + b*Sin[x])^2])/(2*(a^2 + b^2))

________________________________________________________________________________________

Maple [A]  time = 0.058, size = 54, normalized size = 1.5 \begin{align*} -{\frac{a\ln \left ( a+b\tan \left ( x \right ) \right ) }{{a}^{2}+{b}^{2}}}+{\frac{a\ln \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) }{2\,{a}^{2}+2\,{b}^{2}}}+{\frac{b\arctan \left ( \tan \left ( x \right ) \right ) }{{a}^{2}+{b}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(a*cos(x)+b*sin(x)),x)

[Out]

-a/(a^2+b^2)*ln(a+b*tan(x))+1/2/(a^2+b^2)*a*ln(tan(x)^2+1)+1/(a^2+b^2)*b*arctan(tan(x))

________________________________________________________________________________________

Maxima [B]  time = 1.71766, size = 119, normalized size = 3.4 \begin{align*} \frac{2 \, b \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a^{2} + b^{2}} - \frac{a \log \left (-a - \frac{2 \, b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac{a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{a^{2} + b^{2}} + \frac{a \log \left (\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{a^{2} + b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a*cos(x)+b*sin(x)),x, algorithm="maxima")

[Out]

2*b*arctan(sin(x)/(cos(x) + 1))/(a^2 + b^2) - a*log(-a - 2*b*sin(x)/(cos(x) + 1) + a*sin(x)^2/(cos(x) + 1)^2)/
(a^2 + b^2) + a*log(sin(x)^2/(cos(x) + 1)^2 + 1)/(a^2 + b^2)

________________________________________________________________________________________

Fricas [A]  time = 0.501445, size = 112, normalized size = 3.2 \begin{align*} \frac{2 \, b x - a \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) +{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}\right )}{2 \,{\left (a^{2} + b^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a*cos(x)+b*sin(x)),x, algorithm="fricas")

[Out]

1/2*(2*b*x - a*log(2*a*b*cos(x)*sin(x) + (a^2 - b^2)*cos(x)^2 + b^2))/(a^2 + b^2)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a*cos(x)+b*sin(x)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [A]  time = 1.18595, size = 74, normalized size = 2.11 \begin{align*} -\frac{a b \log \left ({\left | b \tan \left (x\right ) + a \right |}\right )}{a^{2} b + b^{3}} + \frac{b x}{a^{2} + b^{2}} + \frac{a \log \left (\tan \left (x\right )^{2} + 1\right )}{2 \,{\left (a^{2} + b^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a*cos(x)+b*sin(x)),x, algorithm="giac")

[Out]

-a*b*log(abs(b*tan(x) + a))/(a^2*b + b^3) + b*x/(a^2 + b^2) + 1/2*a*log(tan(x)^2 + 1)/(a^2 + b^2)